<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>strcatk</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="strcat.html" title="strcat" />
    <link rel="next" href="strcmp.html" title="strcmp" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">strcatk</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="strcat.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="strcmp.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="strcatk"></a>
      <div class="titlepage"></div>
      <a id="Indexstrcatk" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">strcatk</span>
        </h2>
        <p>strcatk — 
      Concatenate strings (k-rate)
          </p>
      </div>
      <div class="refsect1">
        <a id="idp153423200"></a>
        <h2>Description</h2>
        <p>
      Concatenate two strings and store the result in a variable. <span class="emphasis"><em>strcatk</em></span> does the concatenation both at initialization and performance time. It is allowed for any of the input arguments to be the same as the output variable.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp153424912"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">Sdst <span class="command"><strong>strcatk</strong></span> Ssrc1, Ssrc2</pre>
      </div>
      <div class="refsect1">
        <a id="idp153427088"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the strcatk opcode. It uses the file <a class="ulink" href="examples/strcatk.csd" target="_top"><em class="citetitle">strcatk.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp153428944"></a>
          <p class="title">
            <strong>Example 873. Example of the strcatk opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in</span>
-odac           -iadc    <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o strcatk.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

  <span class="ohdr">sr</span>	    <span class="op">=</span>  48000
  <span class="ohdr">ksmps</span>	    <span class="op">=</span>  16
  <span class="ohdr">nchnls</span>    <span class="op">=</span>  2
  <span class="ohdr">0dbfs</span>	    <span class="op">=</span>  1

<span class="comment">; Example by Jonathan Murphy 2007</span>

    <span class="oblock">instr</span> 1

  S1	    <span class="op">=</span>  "1"
  S2	    <span class="op">=</span>  " <span class="op">+</span> 1"
  ktrig	    <span class="opc">init</span>      0
  kval	    <span class="opc">init</span>      2
<span class="octrl">if</span> (ktrig <span class="op">==</span> 1) then
  S1	    <span class="opc">strcatk</span>   S1, S2
  kval	    <span class="op">=</span>  kval <span class="op">+</span> 1
<span class="octrl">endif</span>
  String    <span class="opc">sprintfk</span>  "<span class="op">%</span>s <span class="op">=</span> <span class="op">%</span>d", S1, kval
	    <span class="opc">puts</span>      String, kval
  ktrig	    <span class="opc">metro</span>     1

    <span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">i</span>1 0 10
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
            Its output should include lines like this:
      </p>
        <pre class="screen">
1 + 1 = 2
1 + 1 + 1 = 3
1 + 1 + 1 + 1 = 4
1 + 1 + 1 + 1 + 1 = 5
1 + 1 + 1 + 1 + 1 + 1 = 6
1 + 1 + 1 + 1 + 1 + 1 + 1 = 7
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 8
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 9
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 10
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 11
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 12</pre>
        <p>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp153434288"></a>
        <h2>See also</h2>
        <p>
          <a class="link" href="strcat.html" title="strcat">
            <em class="citetitle">strcat</em>
          </a>
        </p>
      </div>
      <div class="refsect1">
        <a id="idp153436112"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Istvan Varga</td>
          </tr>
          <tr>
            <td>2005</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in version 5.02</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="strcat.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="strcmp.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">strcat </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> strcmp</td>
        </tr>
      </table>
    </div>
  </body>
</html>
